package cn.marinda.factory;

import cn.marinda.config.AbstractServerConfiguration;
import cn.marinda.config.PropertiesServerConfig;

/**
 * 服务器配置工厂
 *
 * @author admin
 * @date 2022/07/25
 */
public class ServerConfigFactory {

    /**
     * 通过名字获得服务器配置
     *
     * @param name 名字
     * @return {@link AbstractServerConfiguration}
     */
    public static AbstractServerConfiguration getServerConfigurationByName(String name){
        AbstractServerConfiguration serverConfiguration = null;
        switch (name){
            case "properties":
                PropertiesServerConfig propertiesServerConfig = PropertiesServerConfig.instace;
                serverConfiguration = propertiesServerConfig;
                break;
            default:
                serverConfiguration = null;
                break;
        }
        return serverConfiguration;
    }
}
